main
Sub Main
	dim doc
	set doc = application.activedocument
	Dim P,outputpath
	P= SplitPath(doc.FullName)	
	outputpath = P & "\output"
	newFolder(outputpath)
	dim urlpath
	urlpath = outputpath & "\url.txt"
	dim fso
	set fso = createobject("scripting.filesystemobject")
	if fso.fileExists(urlpath)=true then
		dim fo,url
		set fo = fso.openTextfile(urlpath)
		url = fo.readall
		fo.close
		set fo = nothing
		url = replace(url,chr(13),"")
		dim s,ls,i
		s = split(url,chr(10))
		ls = ubound(s)-lbound(s)+1
		for i=0 to ls-1
			wsh_run s(i)
		next
	end if	
	set fso = nothing
	
End Sub

sub wsh_run(value)
	dim wsh
	set wsh = createobject("wscript.shell")
	wsh.run value
	set wsh = nothing
end sub

sub newFolder(folderpath)
	dim fso
	set fso = createobject("scripting.filesystemobject")
	if fso.folderExists(folderpath)=false then
		'msgbox folderpath
		fso.createfolder folderpath
	end if
	set fso=nothing
end sub
function SplitPath(InString)
	Dim x,PathString, FileString
	For x = Len(InString) To 1 Step -1
		If Mid(InString, x, 1)="\" Then
			PathString = Left(InString, x)
			FileString = Right(InString, Len(InString) - x)
			Exit For
		End If
	Next x
	SplitPath = PathString
End function
